import BaseSchema from '@ioc:Adonis/Lucid/Schema'

export default class TbOrders extends BaseSchema {
  protected tableName = 'tb_orders'

  public async up () {
    this.schema.createTable(this.tableName, (table) => {
      table.string('id');
      table.string('userId');
      table.string("skuId");
      table.bigInteger('qty');
      table.float('price');
      table.timestamp('created_at', { useTz: true });
      table.timestamp('updated_at', { useTz: true });
    })
  }

  public async down () {
    this.schema.dropTable(this.tableName)
  }
}
